const mysql = require("mysql");

const pool = mysql.createPool({
    host:'localhost',
    user:'root',
    password:'root',
    database:'fanke',
    port:3306,
    multipleStatements:true
})

function query(sql){
    return new Promise((resolve,reject)=>{
        pool.query(sql,(err,res)=>{
            if(err){
                reject(err);
            };
            resolve(res);
        })
    })
}

module.exports = query;